First, have a look at the pump motor contactor. If it's not opening properly when the hydraulics aren't being used, the motor can end up running continuously in the background. That'll heat it up fast even at idle. Also worth checking the pressure relief valve on the hydraulic circuit. If it's set too low or stuck slightly open, the pump is basically fighting itself constantly.
Cooling is another one. Check the motor vents are clear and the cooling fan is actually spinning. On the E16 they can get clogged with dust and debris, especially in busy warehouse environments, and the motor temp sensor might not flag it until it's already cooked.
When you do plug in, check the error history and have a look at the pump motor run time versus actual hydraulic demand. That ratio can tell you a lot about whether something upstream is keeping the motor energised when it shouldn't be.
If you're in a situation where the unit is getting to the age where repairs are stacking up, it might be worth running the numbers on a replacement. A modern electric forklift truck (https://lindemh.com.au/products/electric-forklifts) has come a long way on thermal management and component reliability compared to older builds.
Are the hyds working well ?
Any noises or hyd operating issues ?
A motor overheating is generally caused by either bad motor bearings , bad motor fan
Hyd oil too thin , bad windings in motor or hyd sucking air does the pump heat up as well?