The dynamical group of Riemann ellipsoids