I hope you know you can't get 3.3v-5v out of a LM317 with a 40v input without making it super hot.
Linear regulators dissipate the difference in voltage as heat, so if you want 5v @ 100mA (0.1A) , you'll dissipate (40v - 5v ) x 0.1A = 3.5w... with a basic heatsink, lm317 can dissipate about 1-2 watts ... no way you're going to get 1 or 2A with some a voltage difference.
ps, since I just saw the message above mine... yeah a 40v AC rms 20VA will give you a maximum of 40x1.414 - (2x voltage drop on rectifier diodes of about 0.8-1v) = 56.5-2 = ~55v . The maximum current would be about 0.62 x (ac current ) = 0.62 x 0.5a = 0.31A or about 310mA. Better put those secondary windings in parallel to get a about 26 v DC and 600mA