Yes, there is a temperature sensor in all 42RLEs, TJ and JK ones as well. It is in the valve body. Basically it reads almost the same temperature as in the bottom of the pan. The reason why I say almost - bottom of the pan is cooled down by air, and as a result will be a little cooler than the space on top of the valve body bottom plate. The sensor outputs the signal to through the connector on the driver side, where the shift column is. Information that flows through this connector is - temperature and shifter position (user input, when you move the handle in the cabin, it turns the column, and column had a way to report which gear was selected). TCM (in 2003 or 2004) or PCM (in 2005 to 2006) uses these inputs (together with input and output speeds) from the transmission itself in addition to inputs from PCM (throttle position and RPM) to decide on commands that it sends to solenoid pack, through the connector on the exhaust side. If you put reverse, park or neutral, it does not send any commands to solenoid, keeping it default all open and flow of oil is regulated only by the manual valve. if you put into drive, then default is 2nd gear (which is what happens when you are in limp mode - TCM failed to control the solenoid pack and drive simply means 2nd gear) then the TCM starts to work, and starts shifting between 1 to 4 using the solenoid pack to control the flow of oil to the right pistons.
I thought about hacking into this wire, measuring it with scope, and the doing a hack in sensor, but then decided that unlike data wires, this is analog signal, in which a voltage level is what carries the data (not 1 and 0 encoded, but rather a continuous range of voltages to indicate temperatures), so hacking into the line might compromise it and screw up the way TCM makes shift decisions - they depend on temperature - TCM shifts differently when cold and when hot.