UPDATE - How to prevent overheating of my ebike system?
Overheating is caused by overloading. You are using too much throttle on hills that are too steep. Or maybe the rider has an over-eating problem causing too much weight.
Maybe your battery is a modern lower voltage Li-FePo4 one but your charger is for an older higher voltage battery? 10 series Li-FeP04 cells must not be charged higher than 36.5V.