After completing all the grand trials, head for the Elite 4. You'll encounter Gladion on the way up the mountain. Once you beat him, he'll reveal that Lillie went to Mahalo Trail, where you first met her. When you go there, she'll let you battle and catch Lunala. Note that you can do this before or after you beat the Elite 4.