Improving Gradient Methods via Coordinate Transformations: Applications to Quantum Machine Learning