Many organizations don’t worry about creating the define.xml file until right before submission. Others create the file while the study is still ongoing, to benefit from time, cost and process efficiencies.
Regardless of your approach, you should be familiar with the 6 dos and don’ts of Define-XML contained in this guide.