One caveat, if I may.....
Yanmar, like the other builders of smaller (and not so small) makes engines that are adapted to a huge
variety of end uses. A friend that has owned an E-38-200 with a 3 cylinder Yanmar (EY installed when built) for many years also owns a mid size tractor backhoe made by.... Yanmar.
As pointed out, the adaption design and engineering for marine use is important. Our OEM Universal and our replacement Betamarine are Kubota engines/blocks. Strictly IMHO the Beta engineering is far superior than the work by Universal/Westerbeke.
The comment about gathering info from folks "in the trade" is accurate also. When we were preparing for our engine swap, local mechanics advised a new Betamarine, with a Yanmar being second choice. They all said to avoid Volvo.
Back to transmissions. Our Ericson OEM transmission was the Hurth model 50, and given the widespread condemnation of that model we felt very lucky to get 2100 hours out of it.
The Betamarine came with a TMC40.
https://betamarine.co.uk/resources/GA_Drawings/Seagoing/B25-TMC40/#page=1
So far so good.