GenEFT: Understanding Statics and Dynamics of Model Generalization via Effective Theory