In order to preserve the LegacyExchangeDN attribute, take the following steps
1. Open the Global Default Settings
2. Search for the Active Directory section
3. Insert the "AlwaysUseOldExchDn=1" parameter
4. Save the .ini file and close
5. Run the necessary Migration task
Information about the parameter can be found
here