The kinetic energy of a fixed, rotating rigid body is $$ T =\frac{1}{2}\mathbf{\omega}\mathbf{I}\mathbf{\omega}=\frac{1}{2}I_{xx}\omega_x^2 +\frac{1}{2}I_{yy}\omega_y^2 + \frac{1}{2}I_{zz}\omega_z^2 + I_{xy}\omega_x\omega_y + I_{yz}\omega_y\omega_z + I_{zx}\omega_z\omega_x, $$ and when the reference frame is rotated to coincide with the principal axis frame, the inertia tensor is diagonalised and the kinetic energy becomes $$ T = \frac{1}{2}I_x'\omega_x'^2 + \frac{1}{2}I_y'\omega_y'^2 + \frac{1}{2}I_z'\omega_z'^2. $$qftqft This is the form of kinetic energy in the Lagrangian formulation when used to solve the motion of e.g a spinning top.
But how is this legal? The reference frame used to describe $\mathbf{\omega'}$ and $\mathbf{I}'$ is non-inertial. Surely newton's laws and hence the euler-lagrange equations won't work here due to fictitious forces?