From the Ford Pass App Guide. Hope this helps!
Retrieving the Keyless Entry Code for Vehicles with Intelligent Access Keys
You need to have two programmed intelligent access keys for this procedure:
Place the first programmed key in the backup slot, a pocket made specifically for the key fob. (Refer to your Owner's Manual for the exact location of the backup slot.) The key ring must be at the top with the buttons facing toward the rear. If there is no backup slot, place the key underneath the rubber covering at the bottom of the cup holder.
Press the START/STOP button once and wait a few seconds.
Press the START/STOP button again and remove the key.
Insert the second programmed key into the backup slot, then press the START/STOP button.
The factory-set code will appear in the information display for a few seconds. It may not display until after other warning messages have displayed first.