I'm not sure you are going to get the strength you need with expanding foam. Seacast makes a product that you can look into, but it is pricey.

I would see what you have for a transom to start out with. It is most likely plywood. The cheapest route and still a great fix, if done right, is to use plywood and epoxy resin. I get my epoxy resin from US Composites. It is good stuff and they have decent pricing. Seal that plywood up good with epoxy resin and seal the transom up good after the install and it will last longer than either one of us.