There is no rule against having a local disconnect that serves the primary of a transformer. But there is also no rule that requires it. The NEC is a minimum standard for safety. A local disconnect may be helpful to a future maintenance person, but the NEC would not care about that.
As to the secondary of a transformer, there are limits on how far you can go, before hitting an overcurrent device that protects the secondary conductors (not the transformer secondary windings, but the wires leading away from the transformer). You can comply with those limits by installing a local secondary disconnect, but it has to be a fused disconnect. As an example from a recent project that I designed, I called for an enclosed breaker on the secondary side, and I sized it to protect both the secondary windings and the secondary conductors.