Lagrangian formulation of the linear autonomous magnetization dynamics in spin-torque auto-oscillators