ERC20 and ERC721 are, by definition, interfaces.
You cannot attach extra data to the prescribed functions, e.g. transfer() because that will break compatibility with the standard interface.
You didn't say what you want to achieve so it's not possible to be specific about the solution. Two common approaches spring to mind.
ERC20 is for fungible assets - ...