How do you detect sneaking in minecraft bedrock?

No

In the vanilla game via command you cannot tell.

Another Way?

You may be able to tell with a player.json modification with a behavior pack, and then what you can do could be some kind of weird detection system. I will not explain this, you will have to learn about component groups and behavior packs.