The starting point for this situation is that the OCPD has to be right at the secondary terminals. That is, it must be there unless you meet one of the conditions listed in the code, and then you can have it at a distance that is associated with that condition. Take a look at 240.21(C).
To that I will add that for most of the installations that I design, I put a panel with a main circuit breaker within 10 feet of a step-down transformer, in accordance with 240.21(C)(2).