Numerical approach to transit probabilities in the Coulomb approximation: Be II and Mg II Rydberg series