You could add a counter to an entity that you increment each time task queue runs. You could look for this in the microflow that the task queue executes so you know if it has reached the specific attempt number and you can take action accordingly.
Hope this helps.
did you try using the “Task Queue Helpers” module from the marketplace?
It offers a lot of functionality to get insights on the task queues running in the background.
Also what exactly do you mean with “tries”?