The legal explanation for TN visas is the following: An intent to immigrate in the future that is in no way connected to the proposed immediate trip need not in itself result in a finding that the immediate trip is not temporary. Repeated renewal of a TN visa that leads to extended stay in the United States, may still be temporary, as long as there is no immediate intent to immigrate. (9 FAM 402.17-7)
TL;DR what matters is present intent at the time of application and every time you enter the US. It is not illegal if your intent changes after being here for a while.