WKB expansion for a Yang–Yang generating function and the Bergman tau function