Welcome to the forum! I haven't had to do this repair myself, but have stumbled upon past threads that discuss this. The thread Ed mentioned is a good one, but in that thread is another thread referenced that is more detailed. Please read this entire thread linked below to get some insights. Key point, from that thread, is that the metal case of the potentiometer is believed to be an additional heat sink for the Triac. In replacing the potentiometer you may not find one that is a direct replacement so keep this in mind. Worst come to worse, you could always add a heat sink to the Triac to mitigate this should thermal prove to be a challenge. Also, it is possible the potentiometer is the only "bad" component, but most likely it wasn't the first failure, i.e. something else could need replacing. Another challenge is I don't know if you will find an exact potentiometer replacement which will make it hard to put it back together with the speed control knob. In the thread below another forum member got creative on replacing the potentiometer to keep it functional. Good luck with it and let us know how it goes.
https://forum.shopsmith.com/viewtopic.php?f=10&t=2484