Weil–Petersson geometry and the BGW KdV tau function