Check what role the carriers have, and check what role the fighters are. Then consult BattleBehaviorDefs.XML to see if there's a role that will target the role that the carriers were assigned before they target the fighters. Be aware that your ships may engage the fighters first simply because most fighters are assigned roles which get placed forward whereas many carriers tend to be towards the back, and on top of that the fighters tend to be faster.
You may also want to design your fleet around a pair of roles rather than going for a single-role fleet; escorts, for example, are targeted by everything before capital ships are, and so a couple of escort ships with heavy defenses backed up by capital ships with lots of weapons may work out better for you than a more homogenous fleet which is required to spread defenses around more evenly since you will not be as certain which ships will be targeted first.