When:
After hitting level 20 in the Mad Forest, you'll unlock the Inlaid Library. This second map is arguably easier due to enemies only coming from two directions.
Method:
Most of the enemies killed will leave behind small gems. Blue ones are of the lowest value, then green, then red, and very occasionally you'll get even more coloured ones.
These gems are your experience - collect them! Keep collecting enough experience to reach level 40, and you'll unlock the next stage for use in future runs.