Measurement of CP violation in B0→ J/ψKS0and B0→ ψ(2S)KS0decays