Feature Protection For Out-of-distribution Generalization