Working on a real, larger-scale code base, in a context where good SWEng practices are required is probably a better learning path. An internship, as suggested by Jakobeha above is probably the best way.
If an internship is not feasible, and existing projects seem too daunting, it might be easier to start one (or rather several) of your own. As with most things, practicing helps.