Temperature rising

We have a 2000 Subaru Outback. Since the car’s birth the check engine light has been on, even after several repairs were made. As of late the temperature has been increasing when driving up hills (RPMs increasing). This is after two new thermostats and a new head gasket. What else could be causing this increase in temperature?