If a marriage of a person who gives birth to a child conceived by assisted reproduction is terminated through dissolution of marriage or annulment, or is subject to legal separation, before transfer of gametes or embryos to the person giving birth, a former spouse of the person giving birth is not a parent of the child unless the former spouse consented in a record that the former spouse would be a parent of the child if assisted reproduction were to occur after a dissolution of marriage, annulment or legal separation, and the former spouse did not withdraw consent under § 46b-515.