Dynamical symmetries of time-periodic Hamiltonians