As above - the objective introduces a 'special rule: When a squadron with Bomber or a ship is attacking, it may spend 1 die with a [hit] icon to flip 1 random facedown damage card on the defender faceup'.
The rules don't really seem to establish when you would 'spend' an attack die? The closest thing I can think of is the "Modify Dice" option in step 3 of the attack sequence: "The attacker can resolve any of its effects that modify its dice". In this case, 'spending' being the modification. And that would appear to happen before step 4, where the enemy would spend defense tokens.