Generalization Through the Lens of Learning Dynamics