I) A Lagrangian variational principle for Euler's equations for a rigid body
$$ \tag{1} (DL)_i ~=~M_i, \qquad i\in\{1,2,3\}, $$
is e.g. explained in Ref. 1. Here the angular momentum $L_i$, $i\in\{1,2,3\}$, along the three principal axes of inertia is tied to the angular velocity $\omega_i$, $i\in\{1,2,3\}$, by the formula
$$\tag{2} L_i~:=~I_i \omega_i, \qquad i\in\{1,2,3\}, \qquad (\text{no sum over }i).$$
The covariant time-derivative $D$ of a vector $\eta_i$, $i\in\{1,2,3\}$, is defined as
$$\tag{3} (D\eta)_i ~:=~ \dot{\eta}_i+(\omega\times\eta)_i, \qquad i\in\{1,2,3\}. $$
The angular velocity vector $\omega$ plays the role of a non-Abelian gauge connection/potential.
II) To see the $so(3)$ Lie algebra, we map an infinitesimal rotation vector $\alpha$ into an antisymmetric real $3\times3$ matrix $r(\alpha)\in so(3)$ as
$$\tag{4} \alpha_i \quad\longrightarrow\quad r(\alpha)_{jk}~:=~\sum_{i=1}^3\alpha_i \varepsilon_{ijk}. $$
The $so(3)$ Lie-bracket is given by (minus) the vector cross product
$$\tag{5} [r(\alpha),r(\beta)]~=~r(\beta\times \alpha). $$
Similarly, for the corresponding $SO(3)$ Lie group, a finite rotation vector $\alpha$ maps into an orthogonal $3\times3$ rotation matrix $R(\alpha)\in SO(3)$ as explained in this Phys.SE post. Infinitesimally, for an infinitesimal rotation $|\delta\alpha| \ll 1$, the correspondence is
$$\tag{6} R(\delta\alpha)_{jk} ~=~\delta_{jk} + r(\delta\alpha)_{jk} + {\cal O}(\delta\alpha^2). $$
III) A finite non-Abelian gauge transformation
$\omega\longrightarrow\omega^{\alpha}$ takes the form
$$\tag{7} r(\omega^{\alpha})~=~R(-\alpha) \left(\frac{d}{dt}-r(\omega)\right)R(\alpha), \qquad \alpha\in \mathbb{R}^3.$$
An infinitesimal non-Abelian gauge transformation $\delta$ takes the form
$$\tag{8} r(\delta\omega)~=~\frac{d}{dt}r(\delta\alpha)-[r(\omega),r(\delta\alpha)],$$
or equivalently
$$\tag{9} \delta\omega_i~=~(D\delta\alpha)_i, \qquad i\in\{1,2,3\}, $$
where $\delta\alpha$ denotes an infinitesimal rotation vector corresponding to an $so(3)$ Lie algebra element $r(\delta\alpha)$.
We call (7)-(9) gauge transformations for semantic reasons, because of their familiar form, but note that (most of) them are not unphysical/spurious transformations. We stress that the angular velocity $\omega$ is a physical variable.
IV) Finally we are ready to discuss the action principle. The finite rotation vector $\alpha(t)\in \mathbb{R}^3$ plays the role of independent dynamical variables for the action principle. One may think of virtual rotation paths $\alpha:[t_i,t_f]\to \mathbb{R}^3$ as a reparametrization of virtual angular velocity paths $\omega:[t_i,t_f]\to \mathbb{R}^3$. The action reads
$$\tag{10} S[\alpha,\omega]~=~\int_{t_i}^{t_f} \! dt ~L $$
with Lagrangian
$$\tag{11} L~=~\frac{1}{2} L^{\alpha}\cdot \omega^{\alpha} + M\cdot \alpha , $$
where
$$\tag{12} L^{\alpha}_i~:=~I_i \omega^{\alpha}_i, \qquad i\in\{1,2,3\}, \qquad (\text{no sum over }i).$$
The Lagrangian (11) consists of rotational kinetic energy plus a source term from the torque $M$. Here $\omega^{\alpha}$ is the actual angular velocity vector, while $\omega$ here (in contrast to above) is a fixed non-dynamical reference vector, which is not varied. It is sort of a gauge-fixing choice. Infinitesimal variation yields
$$ \tag{13}\delta L
~\stackrel{(11)}{=}~ L^{\alpha}\cdot \delta\omega^{\alpha}
+ M\cdot \delta\alpha
~\stackrel{(9)}{=}~ L^{\alpha}\cdot \left(\frac{d}{dt}\delta\alpha
+ (\omega^{\alpha}\times\delta\alpha)\right)
+ M\cdot \delta\alpha ,$$
which (after integration by parts and appropriate boundary conditions) leads to Euler's equations (1) for the angular velocity vector $\omega^{\alpha}$.
References:
- J.E. Marsden and T.S. Ratiu, Introduction to
Mechanics and Symmetry, 1998.