Domain Generalization via Balancing Training Difficulty and Model Capability