The first thing I'd do is check the thermal paste and dust. A lot of the times when this happens, the cause is related to dust buildup from the system being a couple of years old. In some cases, the problem isn't dust but is related to the thermal paste being dried out.
The first thing to do that is likely to fix the problem is to repaste the CPU and GPU. If you have the dGPU model of this machine, you will also need thermal pads as thermal paste is not sufficient for many laptops with dedicated graphics due to there being a gap.
Here is what you will need:
[https://www.amazon.com/Grizzly-moins-Thermal-Pad-30/dp/B00ZJT2ZS2/ref=sr_1_2?ie=UTF8&qid=1509745364&sr=8-2&keywords=high+performance+thermal+pads|Thermal pads (dGPU only)]
[https://www.amazon.com/ARCTIC-Compound-Performance-Heatsink-Interface/dp/B0045JCFLY/ref=sr_1_1?s=electronics&ie=UTF8&qid=1509745403&sr=1-1&keywords=artic+mx-4|Thermal paste (Artic MX-4)]