Symmetries of linear dynamical systems