The cog tightens itself as you pedal, so having it slip while pedaling forward doesn't make much sense unless it had just loosened up from backward pressure.
When I first install a cog and lockring I grease the threads, tighten the cog clockwise with a chain whip, then the lockring counter-clockwise with a lockring wrench. After that I'll go out do a couple quick sprints to really tighten the cog, carefully ride or walk the bike back inside and then re-tighten the locking again. The last step might not be necessary but I personally do it to make sure everything is tight. I ride brakeless and haven't had a cog slip yet.
Other than that maybe your hub is stripped or the wheel is slipping in the dropout.