How to formalise the "extra-mile" work done by an academic?
At my university, we have this system for PhD students.

I am a PhD student. In my contract, I have "up to 20% department duties". When I get assigned tasks not related to my research — teaching, administrative tasks, presenting our institute to visitors, etc. — I write down the hours. At the end of the semester, I report to my boss how many hours I have worked on such duties. Then, a corresponding fraction of my salary is funded from a different pot of money. At the end of my PhD, this means I will have an equivalent amount of time extra to finish my research before my contract finishes.

I think the system is quite fair, although some tasks — most notably teaching — don't get the actual time assigned, but according to a certain formula. So in practice, I do lose research time by doing teaching, because teaching takes more time than the formula accounts for, certainly if it's a first time. However, it's still much better than a system with no accounting at all, such as I have understood to be common elsewhere in the world.