T4 templates are build-in feature for Visual Studio IDE. Here is the video to get started.
https://www.youtube.com/watch?v=XK17iNvJqQs
T4 can be used in many areas. Recently I am working on big data solutions, in which the scripting language does not provide looping mechanism. The T4 template become handy to bridge the gap and avoid spinning up multiple jobs to process every day data.