Symmetry groups and conserved quantities for the harmonic oscillator