Update:
There is a newer version available than was mentioned originally see here the announcement: https://devblogs.microsoft.com/dotnet/t4-command-line-tool-for-dotnet/
It is located in
{VS_INSTALL_PATH}\Common7\IDE\TextTransformCore.exe.
Based on your comments.
I have tested the approach and did the following:
Add the TextTransform.exe
into your project file
(either with Add Existing Item, Copy and Paste it into your Project Folder and then reference it, or what ever)

Create a new .tt file, mine has the following content
<#@ template debug="false" hostspecific="false" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".txt" #>
<#
var dateTimeNow = DateTime.Now.ToString();
#>
<#=dateTimeNow#>
(Just a simple .txt file will be generated with a DateTime to see that its working)
Declare both files - TextTemplate1.tt and TextTransform.exe
- as Copy always
in its property Copy to Output Directory
.

Now have the following code somewhere, I did it in Main
static void Main(string[] args)
{
File.Delete("TextTemplate1.txt"); //delete the existing file, to make sure the code does what its supposed to do
Thread.Sleep(1000); //wait for filesystem to do its job
var proc = new Process
{
StartInfo =
{
FileName = "TextTransform.exe",
Arguments = "TextTemplate1.tt"
}
};
proc.Start();
proc.WaitForExit();
}
(Droped the path, so its relative to the executing .exe - needs to be in same directory)
And with that you should successfully get this output

Everything works as expected, need more info to help you find your problem.
My TextTransform.exe file:
