There are many different ways to calculate the distance between the Earth and the Sun using a transit. A description of two methods can be downloaded here.
In these methods you will compare tracks of Mercury across the disc of the Sun as seen from two different observing sites. Using the two sets of tracks you can determine the angular shift, or parallax, (in seconds of arc, between the two tracks at one particular time). The distance between the Earth and the Sun can be determined with, the value of the angular shift and the distance between the two observing sites.
Whilst the mathematics simply involves trigonometry, the conceptualization of what is happening and what needs to be taken into account is not trivial, therefore to help if needed, a spreadsheet has also been provided that will compute the result for you.