Xperts!
Since you describe the engine as acting as though it's running out of fuel, I'd take that seriously and suppose that it is running out of fuel. So you have a fuel problem and likely a carburetor problem.
That it runs normally briefly suggests that the carb isn't getting fuel after those first few seconds, which might be a float problem or fuel isn't draining into the carb properly.
Will the engine start again and run normally after this problem has occurred and you have stopped the engine? That might suggest that negative fuel pressure bleeds off once the engine is shut off.
Any engine smoke from the exhaust when this happens? That might suggest too rich fuel rather than too lean.