"Sie lernt mit einem Kaffee."
Kaffee is masculine. It is the gender of the noun in question (kaffee) that determines its article regardless of the gender of the person who owns it etc. I remember this taking a while to get used to in French. For example, 'her brother' would be 'sein Bruder' using the masculine form of sein because it's determined by the noun Bruder, not the gender of the person whose brother it is.