AI turrets (not sure about primary/secondary weapons) seem to be targeting the LOD0 mesh's 0,0,0 point/pivot point
Seen in this timestamped video
https://www.youtube.com/watch?v=KHrqA2no7Gc&t=77s
This is where the model centre (0,0,0) is located

The model centre is placed there for specific ground vehicle-based script reasons but I can see this being an issue with oddly-shaped ships where the model centre doesn't correspond to the ship's hull.
One possible solution is to have a subsystem flag which has AI turret fire target it as a priority until it is destroyed. Also good for showing "targeted" attacks, Wrath of Khan-style against the Enterprise.