On the Strong Correlation Between Model Invariance and Generalization