I'm replacing a 24VAC transformer that supplies power to a motorized skylight
24V AC out at 60 watts implies a current of 2.5 amps.

A 40VA transformer at 24V AC implies a full load current of 1.67 amps.

Those are the facts and I'll leave it for you to decide but here's a clue - only one is probably suitable.