In 2014, Ford started putting dual clutch standard transmissions in their vehicles which are electronically controlled to act like automatic transmissions. There are two pins inside the transmission that each operate one of the clutches. These pins get stuck and when that happens it's like the driver is riding the clutch. This wears down the clutches and that is what causes the heat.
I had this very same problem with my 2018 Ford Focus with the very same symptoms. On Christmas Eve 2024 the transmission shut the car down. I had to limp it home one increment at a time. Like yours did to you, mine would overheat and shut down. It would take 20 minutes to cool down enough to go the next leg towards home.
Ford wanted too much money to fix the problem so I found a shop that would actually fix it for much less money - about half of what Ford wanted. Ford has known about this problem for a very long time and has been sued several times over it and still will not issue a recall. One of those law suits was even the State of California who filed a class action against Ford and won. Even with that, Ford refuses to issue a recall.
Please accept my apologies for not being able to offer advice on how to actually fix this problem. But, knowing precisely what the problem actually is will be of great assistance in finding the cure. You have my best wishes in finding that cure.