At what point in the application process are the "Legal Custody" and "Custody Status" fields assigned?

When the Primary Household parent or Additional Household parents are added in inquiry or application form, they are set with legal custody of the child. Additionally, legal custody and custody status are set when a new person is added and the candidate's relationship to that person is set as Son, Daughter, or Ward.