Jessica Pegula beats US Open champion and doubles partner Coco Gauff to secure her place in the final of the season-ending WTA Finals in Mexico.