Rotationally invariant formulation of spin-lattice coupling in multiscale modeling