Are HVAC Transformers Interchangable (if their power ratings match)
The voltage needs to be the same, and the VA needs to be greater or equal to what you have now.  If your transformer is 40VA and you replace with 60VA, that is fine.  

I would stay within parts intended for use in HVAC units. Electronics supply houses will happily sell you 24VAC transformers, but they may not be listed (certified) for HVAC use.  Anyway, HVAC units will be cheaper due to being made by the millions.