Parashas Acharei Mos · Passuk 18:17
Chabad.org — English translation + Rashi
Torah Temima points to Sanhedrin 75a.
English: From the parallel “zimah hi” we learn that the higher generations are treated like the lower — mother and grandmother are included as well as daughter and granddaughter.
Gezeirah shavah — up and down the generations
Marrying a woman and her mother (or grandmother) is forbidden just as marrying a woman and her daughter (or granddaughter).