Illegitimate is a very antiquated terminology when referring to the birth of children.If you want children you should def get married , better for your kids ( they are not illegitimate) and better for your rights if it goes belly up ,
The meaning being that they are not recognised in the eyes of the law. Thankfully, such Laws are for the most part consigned to history or hardly recognised
Even Religious Establishments now recognise such children.