In battles you collect experience in the form of data. Therefore, the unit is Megs. With every level you can read another book of the Inventor's Friend series teaching you how to make one item at the invention machine. Sometimes it is enough to simply talk top NPCs to get a new recipe.
You start at level 1 with 0 Megs. For each progressive level you have to gather another 2 Megs for each level. E.g. to reach level 10 you already have the 72 Megs from level 9 and have to collect an additional 10 * 2 Megs = 20 Megs.
For the mathematically inclined
Megs[at level n, lower bound] = n * (n - 1)