If it is 50 KVA or less and meets certain conditions, yes.
(B) Hollow Space Installations. Dry-type transformers
1000 volts, nominal, or less and not exceeding 50 kVA shall be
permitted in hollow spaces of buildings not permanently closed
in by structure, provided they meet the ventilation requirements
of 450.9 and separation from combustible materials
requirements of 450.21(A). Transformers so installed shall not
be required to be readily accessible.