Within Item#use, you should call PlayerEntity#startUsingItem. This will start using the item when the item is used.
You can set the maximum number of ticks that the item can be used for with the return value of Item#getUseDuration.
While the item is being used, Item#onUseTick will be called every tick, and its integer parameter is the number of ticks left in the use duration. This is probably where you want to put your logic, since you mentioned that the player should be able to keep holding the item to keep the process going.
At some point, the player will release the item, which calls Item#releaseUsing. Its integer parameter is the number of ticks that the item was used for, so you could also put some logic there.