Teppic is astonished to hear that his great-great-grandmother once declared herself male as a matter of political expediency. It was in fact indeed the custom of the Egyptians to marry their pharaohs to close relatives, and Hatshepsut, daughter of Thutmose I, wife and half-sister of Thutmose II, and mother-in-law of Thutmose III actually did proclaim herself king in order to seize the throne.
Incidentally, Dios is using the wrong word here: A marriage between relatives would be intrafamilial, not interfamilial.