Transylvania is a historical region in central Romania, bounded by the Carpathian Mountains (east, south, west) and the Transylvanian Plateau (north). It does not border countries directly—Romania does. But the countries adjacent to Transylvania's geographic margins are:
Transylvania is entirely within Romania (counties: Alba, Brașov, Cluj, Covasna, Harghita, Hunedoara, Mureș, Sibiu, Bistrița-Năsăud, Sălaj). The countries above border Romania at the edges of Transylvania. No country borders Transylvania directly.
When people ask "what countries border Transylvania," they usually mean "what countries border Romania near Transylvania." The answer: Hungary, Ukraine, Moldova, Serbia.