There is no easy way to do this. Each Lemmy instance uses their own autoincrement ID for posts. So post 12345 here might be post 54321 on another instance.
It has been suggested that each post gets a universal ID (UUID is an example). Then the local server could just examine the URL and redirect the user to the local post. This suggestion hasn’t gotten any traction. The dev team is more focused on fixing the huge performance issues right now.
Lemmy still has some issues that need to be addressed for it to fully replace Reddit for my needs