This is the default behavior for IOS based IPSec endpoints. During the phase 1 negotiation, both devices will identify whether NAT is present in the path between peers and will utilize UDP 4500 encapsulation automatically.
I was more looking at the commands that enable or disable this feature? Or I was wondering if you can "force" udp encapsulation even if there is no NAT in the way (for whatever security reason).
I also found the examples below.
You can disable NAT-T support in IOS using the "no crypto ipsec nat-transparency udp-encapsulation" command. NAT-T is negotiated between Cisco endpoints and cannot be fixed. Without NAT-T support, IOS will continue to encap using UDP 500.