The outside temp can be very different than the internal temp, and the ratio can vary depending on conditions and the design of the motor.
The windings can be hot enough to burn insulation before the outside gets more than warm, under a high enough load.
Under a lower load it can still happen when the outside is still only just too hot to touch.
Even if the windings don't have a problem, the hall sensors can malfunction or fail under enough heat (varies with the actual device used).
If you can open up the motor and install the temperature sensor on the windings themselves (usually tucked between them and the metal stator, glued in place), it's more useful, but it's a PITA to do this, especially putting the pair of wires for the sensor thru the axle with the other wires.
Short of that, all you can realy do is try not to use enough power to heat the motor up that much, or setup something (like the Cycle Analyst) that can monitor temperature and power usage, and roll back throttle when temperature increases beyond the limits you set to keep from overheating.
A CA will also show you what the actual power usage is.
My guess is that either the current is a lot more than 23A, or you're going pretty slowly up the hill (bogging down the motor and overheating it). Because 23A at 48v is only 1100W or so, and a "500w" or '750w" DD (not geared) hubmotor can usually handle that just fine at normal speeds. See the http://ebikes.ca/simulator and read the entire page first, then play with systmes that are similar to yours (the 9C 2807 motor will probably be close enough) under various conditions to see what happens, and it may help you understand what's going on.
FWIW, I have seen 140F ish temps on my *windings* regularly on hot days here, under normal traffic conditions. But the outside is a lot cooler.
I don't know what yours is inside when it's 140F *outside*, but probably hotter than it likes. It might survive it just fine, but I'd add some cooling of some type, and limit the power to it based on temperature (or just limit it anyway), or add a second motor to take some of the load.
There is a tthread for Definitive Testing of Heating and Coooling of Hubmotors started by Justin_LE, which has good data on various methods for helping keep the motor cool.