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