This is an ad-hoc way to eliminate Transport ramming without touching the other light ships. These are the necessary edits and files:
For this exercise we're going to create a new category of ships: trn_ship
naval_fire_junctions
Copy all lines of the light_ship unit category and change the light_ship entry in those to trn_ship
naval_ramming_events
Copy all lines of the light_ship "ramming ship"-category and change that category from light_ship to trn_ship and set all base_damage to 0
naval_units
change the light_ship entry in the category of all shp_trn-class to trn_ship
unit_category
copy the light_ship entry and change that ones light_ship to trn_ship and set localized name to Transport Ship
unit_set_to_unit_junctions
copy the line with the light_ship "unit category" and in that change light_ship to trn_ship
I've done a few large campaign battles with this and while the AI still want to ram you with some of their transports they will never sink you, or you them. After a few rams they will try to board you, so you are not immune to boarding. While I'd like to remove ramming altogether from Transport ships I have not found a way to do so, yet. This change will only affect Transport ships.