The Jeffersons
Edie is George's old army buddy as shown in the Season 4 episode "Once a Friend" and is a trans woman. (1977)
Night Court
In the Season 3 episode "Best of Friends", Dan meets up with a college buddy who is no longer living as a man but is a woman, hence a trans woman. (1985)
It's a Living
In Season 3, episode 12, titled "Gender Gap", Fern Fitzgerald plays a transgender woman who dates Sonny. (1986)
Married... with Children
In season 9's tenth episode, "Dud Bowl", Thad, a former high school teammate of Al, is now a trans woman, to Al's dismay. Nevertheless, she plays football on Al's re-organized team. (1994)
And it's become even more prevalent more recently. TV shows are more "niche" targeted now and don't have the audience size that shows had 40-50 years ago, but plenty of new shows not only have transgender "guest" characters, some have transgender regular characters. So, no, the Love Boat would not be cancelled tomorrow if that episode aired today.
https://en.wikipedia.org/wiki/List_of_transgender_characters_in_television