A person sitting in a swing can't directly generate a lateral force or move his/her center of mass. Instead, a person can lean forwards or backwards on the swing, exerting a torque between swing and where the person holds the chains and initially the center of mass remains at the same spot, but now the chains are angled forwards or backwards, and the tension in the chains now have a backwards or forwards component of tension. It's this horizontal component of tension in the angled chains that initiates and increases the swing.
Once the swing is moving, if the person is standing on the swing, the person can move their center of mass inwards towards the bar at the bottom of the swing where the centripetal force is higher, and outwards away from the bar near the top of the swing where the centripetal force is nearly zero, resulting in net work being perfomed, with a corresponding increase in energy (height of the swinging motion).