in your service manual at the front there will be a sticker with loads of option codes - it'll say your engine code in there, but not explictly as "engine code - xyz", you'll have to work it out by knowing which one represents your engine code
you can also check on VCDS as your engine code will come up there too.
in regards to your gearbox code i have no idea, sorry but i'd imagine that any gearbox from a FWD PQ35 chassis car (A3/Leon/Golf/Octavia etc etc) with a 1.9TDI engine should be a straight swap and as the 1.9TDI is quite common in the A3 i can't imagine that sourcing one should be too hard.