Understanding Self-Training for Gradual Domain Adaptation