Parashas Shemos
וַתַּ֥הַר הָאִשָּׁ֖ה וַתֵּ֣לֶד בֵּ֑ן וַתֵּ֤רֶא אֹתוֹ֙ כִּי־ט֣וֹב ה֔וּא וַֽתִּצְפְּנֵ֖הוּ שְׁלֹשָׁ֥ה יְרָחִֽים׃
The woman conceived and bore a son; and when she saw how beautiful he was, she hid him for three months.
Torah Temimah points to Sotah 12a (verified).
ותצפנהו שלשה ירחים — דלא הוו מנו מצרים אלא משעה דאהדרה עמרם, והיא הות מתעברא ביה תלתא ירחי מעיקרא.
English: “And she hid him three months” — because the Egyptians counted only from the time Amram remarried her, while she had already been pregnant with him for three months beforehand.
Custom — chronological calculation.
Chazal teach that the three months of concealment correspond to the period the Egyptians could not yet have expected a birth from the remarriage.