Here's an article that explains it fairly well:
https://knowledge.safe.com/articles/44622/working-with-foreign-keys-writing-database-tables.html
Personally I tend to use the SQLExecutor when possible, it lets me control the insert order and transactions with a lot of precision.
Another good option would be to use two FeatureWriters, one for the partents and one for the children, chained in a sequence either by activating the output of the input features, or by using a FeatureMerger on the Summary port to trigger the second FeatureWriter.Something like