Tracking continuous gravitational waves from a neutron star at once and twice the spin frequency with a hidden Markov model