Equations of motion for a spectrum-generating algebra: Lipkin–Meshkov–Glick model