How to increase weapon strength with the player

I’ve got a player who’s character has a home-brew weapon that’s supposed to grow in strength alongside the character so it can be used through the whole campaign.

I get that normally, throughout the campaign, characters would swap their current equipment with better alternatives and also enchant their stuff to keep them relevant against stronger encounters, but I’m trying to accommodate for that in just one weapon, so there’s no need to switch if the player doesn’t want to. That and the lore behind this particular weapon reflects the growth in strength alongside the player since, once acquired, it’s supposed to become this particular character’s permanent primary weapon.

I’ve considered using a level system similar to players’ to increase damage, and grant effects as it grows, but idk if that’s the best option, or what to do in order to achieve the desired effect.

The weapon is based off and started out as a standard short-sword, but since it’s magic (and legendary), we’ve already applied the standard +1 from masterwork.

Thankfully it hasn’t come up yet, so i have a little time to iron this out, but it’s bound to be needed soon.

Any recommendations?