Same as you learn other spells.
1) If using RMC, core rules, you buy ranks and then roll for each spell above 20th level, and then repeat for the next higher spell. (Note: only Base lists may be learned above 20th level according to the core rules)
2) If using RMC individual development options (or RMFRP), you pay for the intervening ranks accordingly.