Does Battle Cry happen before or after Initiative is rolled?

The Feat Battle Cry reads

When you roll initiative, you can yell a mighty battle cry and Demoralize an observed foe as a free action. If you’re legendary in Intimidation, you can use a reaction to Demoralize your foe when you critically succeed at an attack roll.

There are similar abilities, such as Hobgoblin Generals’ General’s Cry.

Do effects like this occur before or after initiative is rolled; specifically, does this (potentially) affect the target’s Initiative roll?