We use a screw to connect the shifting shaft to the dog. There is a slot in the output shaft which gives the screw/shaft/dog clearance to slide back and forth, engaging one or the other gears.
Here is a cutaway that team 45 posted a few years back showing how it works.

__________________
-Travis Covington
2008-2017 - Engineering Mentor of
Team 254
2001-2008 - Engineering Mentor of
Team 968
1998-2001 - Mechanical Director/Driver/Member of
Team 115