5 months before, the officers will definitely tell you to go away and come back right before old TN expires / desires start date of new TN.
At San Ysidro I tried 2 weeks in advance, they told me it was too early & come back 3 days before. Other ports / other officers may tolerate up to 2...