1. After preparing the structure of your source to query transform. Right click on the out schema in query transform and select 'Create File Format':
2. Provide the details and use it as Flag File template:
3. Make it as target in the dataflow mapping:
4. Double click the target file and set up the file location and name:
There you go!