Not to worry - task IDs and thus task links do not ever change over time.
The only thing I’ll mention is that a task’s link also contains the project it’s in, so once you capture a task link, be sure not to remove the task from that project. Or if you think you might be changing projects, an alternative is to replace the first long number in the link with a 0 (zero); in that case the link will bring up just the task, divorced from any project.
Regular task link to a task in a specific project:
Link to that task without any project reference: