Thanks to the Mercury transit, you can measure the parallax from the Earth. That happens due to TRACE , which tracks the transit of Mercury along the polar diameter of the Earth.
During that tracking, the transit of Mercury goes like that:
[
Now notice that, if TRACE remained stationary, the transit would be a straight line. So, if you calculate the maximum separation vertically of the center of Mercury and divide by two (how it's another different story), you got the parallax angle $\theta$:
You know $\theta$, you know Earth radius, so you know D, the distance from Earth to Mercury (in km) because
$$\tan\theta = R/D$$
Now, if you wanna know how many km a AU is, just realise that Mercury is 0.56 AU from us, so divide D/0.56 and you got it!
All images credited to NASA/IMAGE and/or Lockheed Martin/TRACE