navigation – Dynamically load the menu items created from the links.task.yml file

I need to programmatically load the links that are generated from the my_module.links.task.yml on another page.

My exact use case is that I have a set of links that show when viewing my node page. The links will and show and hide based on the current user’s access and the access control is handled through the options in the my_module.routing.yml file.

I need to create a separate page that displays node data in a table and I need to show these links in a dropdown option (similar to how the edit button functions when viewing content as an admin).

Is there a way to dynamically get the links so I can then display them in my dropdown?