Katie Boulter claimed her first ever WTA 500 title with a stunning comeback victory at the San Diego Open.