I used a product called SeaCast to rebuild a transom once. Its a great product.
My transom was so rotten I didn’t even have to cut the glass on the inside or out. I was able to dig out all the rot it was so far gone. It is very important to get ever last chunk of wood out if you go this route.