Optimizing ML Training with Metagradient Descent