On the Strong Correlation Between Model Generalization and Invariance