The battle XP bonus is based on the computed "size" of your fleet compared with the enemy's fleet (or fleets if you're fighting multiple ones). That size is based on the total DP, so I call it "XP DP". It's a straight ratio; if the enemy's XP DP is double of yours, then you get a +100% XP bonus. The maximum bonus is at +500% XP bonus, at which point your XP DP is 1/6 (or smaller) of the enemy.
Each side's XP DP is the sum of the DP of each ship. Civilian ships (ships with a "CIVILIAN" tag in ship_data.csv, not the civilian hullmod) count as 1/4 of their DP, as do any non-civilian ships with absolutely no weapons (including no fighters). If a ship has d-mods, then each d-mod is *0.9 of the original DP (so 3 d-mods means the ship counts as 72.9% of the original DP).
From there, add 7.5 + 3.75 * level for each officer on your side (including the player character). For the enemy side, it's doubled, so their officers count as 15 + 7.5 * level each.
There are a couple of other modifiers, such as if a ship is mothballed, or if it has low CR, etc. But this covers the main rules.
At the end, multiply the enemy side by 0.67.
Then it's just simply a ratio of the two. If (enemy XP DP) / (your XP DP) > 1, then your XP gets multiplied by that amount, up to +500% or 6x.
You don't have to worry about all the math. Just know that it's the ratio between the enemy fleet and your fleet, and that a level 4 officer counts as 22.5 DP and a level 6 officer counts as 30 DP. Your player character, once you reach level 15, counts as 63.75 DP.