With Control Variable-- you can assign a variable to be equal to a given event's Map X or Y, among other things.
As a side note, if you haven't done it yet, take a good long look at all of the things that you can do with Control Variable and Conditional Branch. Some of them are very surprising, and have a lot of clever uses.