(Apparent) chain slippage causes on new bike - usual culprits already eliminated
If everything is shifting smoothly and the hanger is aligned, it's very likely the freehub body slipping intermittently, which feels much like the chain slipping. Usually it takes a visual to be sure it's the freehub and not the chain.

Different freehub designs call for different procedures to fix and investigate this. The root cause could either be overly viscous/gummy lubrication causing the freehub pawls (or other engagement element depending on the design) to not spring back rapidly enough, causing incomplete engagement, or an issue such as a broken, mangled, or out of place pawl spring. I've seen both on new and new-ish bikes. Ideally at this point one would put their eyes on the freehub internals themselves to check for damage, which can occur from skipping with partial engagement, often in the form of a pawl tooth getting blunted or torn. Some designs make such a check easy, i.e. many cartridge bearing hubs, but others make it impractical, like generic OEM cup and cone hubs where freehub disassembly isn't really intended to be possible.

The good news is that usually it's just some overly thick lubrication at the pawls and fixing it is often as simple as getting some light oil worked in to reduce the overall viscosity. Usually Tri-flow or similar. If it's a "closed" design freehub it can just be dripped in at the crack, sometimes by temporarily pulling a seal first.

By taking the cassette off the wheel and turning the freehub by hand, experienced mechanics can take a pretty good guess whether there's something wrong inside. Not 100% accurate but there have been many times where I've done this and found it to be obviously rough or felt something jangle inside, implying a spring issue.