Measurement of CP violation in B0->J/ψKS0 and B0’->ψ(2S)KS0 decays