Fluxes and nuclear abundances of cosmic rays inside the magnetosphere using a transmission function approach