I have seen that as one of the many ways of holding the brushes and springs in place on Flyer prewar motors. It is more common to find on one side of the engines that did not have reverse, as the cotter pin would hold a larger diameter spring to ground that side of the armature to the frame, but I seem to recall seeing it on both sides, similar to your engine.
As your engine has been worked on before (to replace the wheels) it is possible that the person who replaced the wheels added the cotter pins at that time.