Interesting question 2017 NEC 680.24 Seems to mostly apply to "nicheless" no-niche fixtures. However 683.23(B)(2) seems to require a junction box or "other enclosure" complying with 680.24. My guess is you would need to meet 680.24(C)(E) and (F) as the others seem to refer to no-niche. I would assume a "panel board / transformer" could be considered an "other enclosure".
Edit after re-reading it I think 683.23(B)(2) pulls in the entire thing so your "other enclosure" can be used if it meets all the requirements in 680.24.