I'm assuming your transom is poured so you'll not have any concerns but this is what i found under my plastic trim.

This pic is after I removed a good deal of the "caulking" on the port side. I never found a replacement trim piece so...
I removed the starboard side (which was in pretty good shape) and had two aluminum pieces made.

I filled in the voids on both sides (created after removing the old caulk/bedding compound) with thickened epoxy.

Using the starboard half (I cut the plastic close to the engine) I had the shop fab that one and a mirror for the port side. I did not replace the piece under the motor.

Good luck.