That's what you'd do anyway? You wouldn't need to store items tacks for each item you enchant with. Just give certain items an enchantment identifier (probably a string) and define its function depending on the Id.
I can't think of any way to logically do this without some sort of nbt. It just...