The Role of Stiffness in Training and Generalization of ResNets