You need 247,000 xp to get to level 20. I got gold on all races but 2 my first try and was level 16 when I got the achievement for all gold medals.
To get the xp you need to get level 20 from there, replay Iceland Trick Sessions or Rival events because they are the shortest and give the most xp.
If you wait until you have all gold medals, you will have less to grind in the end and they will be easier with a maxed out bike.
I chose to do Geyser Field in trick mode after I got all gold and got over 7,000 xp for getting 100,000 points in a run each time.
From level 16 it took me 14 runs of this track at an average of 6,500 xp each time.