In 99% of the situations, a disconnenct/OCP would be needed on the transformer secondary within 10 or 25 ft {See 240.21(C)} for details}
On two-wire primary/secondary, delta-delta, or outside secondary conductors, the rules could allow greater distances if the transformer has proper primary overcurrent protection per Art 450.3
The devil is in the details.