To override a profile menu, you will have to implement an interface called forceCommunity:profileMenuInterface. The following code snippet shows how to create a custom component to override a profile menu:
<aura:component implements="forceCommunity:profileMenuInterface" access="global">
<lightning:buttonMenu alternativeText="Toggle menu">
<lightning:menuItem label="My Account" value="account" iconName="utility:table" />
<lightning:menuItem label="Add Credit Card" value="addCard" iconName="utility:table" />
</lightning:buttonMenu>
</aura:component>