There are some TMs that are exclusive to certain generations, such as TMs from Pokemon Colosseum and Pokemon Diamond/HG. Can those old TMs be repeatedly transferred (held by Pokemon) up to Sun and Moon? If a Pokemon carrying one was traded into a new generation, what would happen?
I am afraid that item transfers like this simply aren't possible. Both Pokemon Bank and PokeTransporter do not allow held items to transfer. If you try, the item will be placed back into your bag and the Pokemon will transfer over without an item. If you want to take advantage of older TMs, you'll have to put the move on the desired Pokemon and then transfer it over. It should also be noted that TM moves no longer count as egg moves and will not carry over to a child unless it just happens to also be an egg move.
I hope that this was helpful!