How does padding work in transpose convolution?

That is the definition of how padding works. The formula for the dimensions of the output is given on this thread.