I implemented a system that made sense to me as a Sim mod (in the Vault as Shared Experience). It awards XP based on mass cost, and adjusts veterancy such that each unit needs to kill about twice its mass in enemy units fore each level. It also shares experience around attackers based on damage dealt, rounded up.
What I found when playtesting is that experimentals have a huge amount of difficulty leveling with this system. A monkeylord needs to kill nearly 40 harbs, or nearly 400 strikers to vet once. Compared to vanilla, where 50 strikers or 17 harbs will do the trick. This suggests to me that experimentals vet too easily in vanilla, and that the levels should at least be increased. It also suggests that basing the system purely on mass cost might not be ideal, as build time and energy cost are also a factor in a unit's construction. If I had used some combination of build time and mass cost, the ml would level slightly more easily as it has a much lower build cost than its mass in t1-t3 units.
Another thing I noticed was that a UEF scout escorting 2 t1 tanks vetted very fast. It would deal about 4 damage total to something before the tanks would kill it, then get 1 xp due to rounding. Because its mass cost was so low, it would be max vet after only a few targets. The simplest solution to this would be to round xp to the nearest integer instead of rounding up all the time.
I made leveling behave differently, too. Instead of a chunk of HP restored, they get a 5% per level buff to damage, speed, max hitpoints, and current hitpoints. (I left regen untouched). This way, the unit's fractional health remains the same. A unit that levels when nearly dead remains nearly dead, while a unit that vets while healthy can make better use of the health buff. By buffing damage as well, veterancy becomes useful to units which can't take much damage such as sniper bots and artillery (at least in theory. I haven't playtested this aspect much).