Debugging your task code in dev is supported via VS Code, without having to pass in any additional flags. Create a launch configuration in .vscode/launch.json:
Then you can start debugging your tasks code by selecting the Trigger.dev: Dev configuration in the debug panel, and set breakpoints in your tasks code.