You can either walk (the pathway is lighted and it's about 2/3 of a mile from the Luna Park pool to the MGM entrance ) or take a boat. The boats generally run until an hour or so after the park closes.
When I was there last week, MGM & Epcot closed at 9:00, the boat driver said the last boat to MGM was 9:20 in case people parked at MGM and then went to Epcot and wanted to go back to MGM to get their car.