Apologies for the necro, but I was also curious to the answer for this, and while I wasn't able to find an answer online. I was able to use desmos to get a function that would fit within +-15 exp for most levels, for the most part it is theoretically scalable for however many levels you need for mods too.
Explanation:
levels 3, 4, and 5 were a little mean, and I don't think there is a good solution for them, they probably have a lower exp threshold so that it is easier to get your first perk than it would otherwise be. To scale the function just add terms with the format (x/n)^(2.5n) where n = the level. The level 3 and 5 exponents had to be changed so that it generally fit, if someone can make a better curve, then I would love to see it. Another note is that aside from the first 5 terms since they are the base function, every 3rd term after that is a negative term, I could also modify the constant to get it to be a general better fit, but I am tired at this point. There has to be a more elegant way, it looks so clunky, and while I was able to get generally "close" with more elegant solutions, none of it was nearly as close as this.
TL:DR, the function:
-10 + 16x + 60x^1.5 + 26x^1.56 + (4x)^2.239 + (x/1.5)^4.575 + (x/2)^5 - (x/3)^7.65 + (x/4)^10 + (x/5)^10 - (x/6)^15 + (x/7)^17.5 + (x/8)^24 - (x/9)^22.5 + (x/10)^25
(is there a better way to format math here?)
edit: I have just realized my level 8 term is also not following the pattern, oops.