There is a sensor in the radiator which controls the cooling fans. If it's bad the fans won't come on when they should. The sensor can be tested to see if it's operating correctly. I'm surprised the dealer didn't do this. There's also a relay for the fans, and it, too, could be bad.
It's also possible that the temperature sender that works the gauge is bad, or the connection to it is dirty or corroded, and the engine is not really overheating.
It's good that you're monitoring this, because Subaru engines do not handle true overheating very well.
If you start the engine and let it idle (you don't have to drive the car) it should warm up to normal temperature, at which time the thermostat will open and allow coolant to circulate through the radiator. As the coolant in the radiator heats up the fans should come on.
If everything is working correctly you could let the car sit and idle all day. The fans should cycle on and off to maintain the correct coolant temperature, and the gauge should move very little, if at all.
You can open the hood and watch all of this happening. You'll be able to feel the radiator getting hot after the thermostat opens, and you'll see and hear the fans when they come on. Keep your hands away from the fans; they can come on at ANY time.
Perhaps trying this, while watching the gauge, will give you some additional information.
I'm still trying to figure out what's magical about 40 degrees.