The Shulchan Aruch או"ח סימן שכח סעיף לד ו-לה rules that a woman is not allow to hand express milk into a vessel in order to feed an infant from it. She is allowed to hand express into the infants mouth in order to get it to latch on.
In סימן של סעיף ח the Shulchan Aruch adds that if the mother is in pain from excess milk she is also allowed to hand express. The Mishna Berura in ס"ק לד adds that this has to be done in a manner of איבוד meaning that the milk should not be collected in a way that it can be used late, for example, the mother should express is it onto the ground. This will render it not being a melacha of מפרק and it will also be a מלאכה שאין צריכה לגופה.
Contemporary poskinm add that pumps can be used for that purpose. See שמירת שבת כהלכתה פרק לו סעיף כא. Additionally, she would be allowed to pump in order to upkeep her supply so that the baby shouldn't starve.
What would the Halacha be if a women wants to hand express because she wants to keep upkeep her supply even though her infant can survive on baby formula? What is the baby is anyways partially formula fed?