You buy a template, customize it and sell the end product (the render of the customized template) to the client. If the client is going to use it in a way that’s free to see -i.e. a TV commercial, Youtube video, in-store promotion etc. then you need a Regular License.
However, if the end product is something that’s for sale, or part of something that’s for sale - for instance a computer game, a DVD, a set of web tutorials that are sold as part of a subscriptions service… then that would require an Extended License.
But for templates in general, a new license (whether Regular or Extended) is required for each new customization. You can’t buy a template once and then customize it for multiple clients.
So every time you make a sale, you need a new license purchased.
I am assuming you are not doing that, so yes what you are doing is illegal.