show/hide this revision's text 2 typos fixed

Unless for some reason you absolutely must work within the Hamiltonian approach, you can just directly look for the complete set of (infinitesimal Lie point) symmetries of the Euler--Lagrange equations or of the action itself. The procedure is standard and described in many good books. For instance, you can look into those by Olver (more math-y) or Stephani (somewhat closer to physics). Using the theory from this book these books you can also verify whether the transformation at the end of your question is indeed a symmetry.

show/hide this revision's text 1

Unless for some reason you absolutely must work within the Hamiltonian approach, you can just directly look for the complete set of (infinitesimal Lie point) symmetries of the Euler--Lagrange equations or of the action itself. The procedure is standard and described in many good books. For instance, you can look into those by Olver (more math-y) or Stephani (somewhat closer to physics). Using the theory from this book you can also verify whether the transformation at the end of your question is indeed a symmetry.