How to get the path that is automatically calculated when the unit moves?
You cannot ahead of time. You can log the path a unit takes by sampling its position periodically and then use that log.
One can also display a path between 2 points that vaguely follows where units ordered between the points would go. However I do not think it is possible to get the line points from it.