Defender Sword: do I use its property before or after the 1st attack?

In dnd 5e, the description for the Defender sword is (emphasis mine):

You gain a +3 bonus to attack and damage rolls made with this magic weapon.

The first time you attack with the sword on each of your turns, you can transfer some or all of the sword’s bonus to your Armor Class, instead of using the bonus on any attacks that turn. For example, you could reduce the bonus to your attack and damage rolls to +1 and gain a +2 bonus to AC. The adjusted bonuses remain in effect until the start of your next turn, although you must hold the sword to gain a bonus to AC from it.

I have 1 question:

  1. The description states that I can transfer a portion of the attack roll modifier to my AC the first time I attack. So if I’m a character that can hit twice in 1 round, does that mean I can choose to transfer a portion of the attack modifier just after my first attack? Or is it just before my first attack? It sounds to me like I get the attack bonus for the first attack of my turn, and then if I want to do the transfer, I can activate it just after that first attack, but the transfer is not allowed any other time.