Energy dependence of forward-rapidity J/ψ and ψ(2 S) production in pp collisions at the LHC