Preamble
As I tell regularly: EMC is a holistic topic. There's not a whole lot that can be said about a small snippet, in isolation, and almost always there are contributions from seemingly unrelated elements. (The most common and important omissions probably being other connectors or boards, critical information as they determine the common mode self-impedance, where and how noise can flow across the system.)
So I will lecture about this, only briefly, in the hopes that a few more readers see and appreciate this about the topic, and consider repeating it themselves in comments and answers when the need arises. This is unfortunately a platform wholly unsuited to soapboxing (well, and with good reason; but this subject happens to be one that would benefit from it, IMHO), so I accept the Sisyphean task of adding this note every time.
Anyway, as an EMI resolution is not being sought, it doesn't seem worthwhile or necessary to close the topic, and mere speculation will suffice.
The likely purpose is to shunt RF noise to ground.
This includes some noise coming in from the line itself; a single modest-value cap won't do a whole lot, but perhaps a minor reduction is sufficient. Likewise, it provides reduction of outgoing noise.
Since a chassis connection is used, we can assume a metallic enclosure, which acts as a ground/reference plane for RF purposes. The AC cord entering the enclosure, then, can be treated as an RF port.
A port is a location within a circuit/system, that can be treated as zero-dimensional for purposes of circuit analysis, up to some limiting frequency. That is, we don't care about the length or width of the wires or connectors or pins in the immediate region, it acts point-like for all frequencies up to, say, 100MHz or so -- typical frequencies where electrical and electronic equipment are likely to have emissions.
That is, we can use AC steady-state circuit analysis, and draw an RLC equivalent circuit where, equivalently: the length dimension of that circuit is zero; or the speed of light is infinite. That is, when we do AC analysis, we're assuming all nodes/meshes in the circuit change simultaneously with each other.
Conversely, we must be cognizant of the speed of light, when wire length is not negligible, when the length of nodes or loops is comparable to a fraction of the wavelength at the maximum frequency being considered, where transmission lines are used (in a more explicit and intentional sense), etc.
A cable passing through an enclosure, serves this role, because the hole in the enclosure can be much smaller than the wavelength of interest (i.e., 100s MHz, ~m wavelength; a 1 cm hole is "pointlike"), and so too, the filter can be close to it. The capacitors in question might be 1 or 2 cm long, which are again quite small, so can be treated as an RLC series equivalent circuit (which is where ESR and ESL come in).
Placing a filter network at this port, provides filtering, while eliminating sneak paths: if it were not point-like, there would be some stray wire length, or ground-return path, or lack of shielding, etc., which manifests as extra series inductance, or a transmission line (a 1-dimensional structure), or where full fields have to be considered (full 3D structure), and at the very least we must expand the scope of our analysis (to include nearby connections), but in the process we will eventually violate the "point-like" assumption, and our model falls apart. Using a metal enclosure provides separation, localization -- shielding, necessary to enable this kind of analysis.
As for what the rest of the circuit is doing, who knows, but given the switch and transformer, it's possible that the circuit after the transformer is quite noisy, and the transformer is wound in such a way that just enough RF noise coupled across it, and they needed the extra filtering.
Transformers, themselves, are filter networks. You may have an inkling of this already. As a ball of wire spooled up around insulators and more metal, the length and arrangement of all that wire, makes a difference for its RF response. Mostly, leakage inductance is dominant (a consequence of the two windings being spooled up separately, the most common being horizontally-laid layers stacked one block at a time, or rectangular banks side-by-side; the blocks can be interleaved (alternating pri/sec layers, say) to reduce this, but there's largely no point for mains power transformers; this is an important technique for wideband signal and SMPS transformers, though), which manifests as series inductance, providing additional filtering value with the capacitors.
It could also be as trivial as attenuating noise from the switch. The transformer is inductive, so at the instant of turn-off, when the mechanical contacts begin to separate, in those first few microseconds, the separation grows to some micrometers; meanwhile, residual charge (flux) in the transformer begins to discharge into the now-very-high impedance (an ~open circuit; mostly, transformer capacitance dominates at this stage, so the voltage rises linearly with time), and the dV/dt at the transformer is higher than the switch's d(gap)/dt and pretty soon breakdown voltage is reached, causing a spark. Since the contact has barely opened (some micrometers), this can happen in just a few hundred volts (give or take what mains voltage is at, at the same instant; consider what happens if switching randomly at any point during a 60Hz cycle, which also determines residual flux). The transformer's winding capacitance discharges into the mains network, emitting a fast, high-voltage pulse; the risetime can be fractional ns (air sparks are fast!), and the duration some 10s or 100s of ns. Pretty quickly the spark current decays, it cools off, stops conducting, and the cycle repeats: the transformer's inductance continues to discharge into capacitance, but next time, the switch has opened a little bit more, so the breakdown is a little higher, and so on.
What ends up happening is a rapid-fire machine-gun burst, with the amplitude per pulse increasing and the time between pulses decreasing (as it takes more time for less remaining charge to reach a higher breakdown voltage). The pulse repetition rate can be 100s kHz. Finally, the transformer voltage rings up to just below the contacts' breakdown voltage, no spark occurs, and the winding rings down on its own (usually around some 10s-100s kHz).
Usually, an R+C is placed across the switch to snub this: the increased capacitance gives a far slower dV/dt as the transformer discharges, and the R provides some damping along with the transformer's own resistance. The R also serves to limit switch-on current, which would otherwise dump the capacitor's charge into the switch contacts, eroding it rapidly.
Putting capacitors at the line, serves a similar purpose, but only attenuates the spark-dump waveform without preventing it entirely.
It's possible they chose this route for a combination of reasons; perhaps damping the switch sparking was a lower priority, or not a concern at all. And regardless of what the switch is doing, if they needed to deal with electrical noise, filtering is required.
A more modern alternative would probably be a line-entry module incorporating a common-mode choke (CMC) and smaller Y-type capacitors. The choke increases the impedance between load and filter capacitor(s), allowing smaller capacitors to do the same job -- hopefully. We of course cannot conclude from here, whether a CMC would provide enough impedance compared to the transformer itself, which likely has a modest impedance already.
Back in the '80s, GFCI circuits were only in common use I think around water -- outdoors, bathrooms and kitchens; it seems unlikely one would need to use a printer in these locations, and perhaps they didn't have other ground-leakage standards to worry about in those days, so considered the X-caps sufficient. Now that GFCI/RCD for all circuits, or whole-house, is becoming widespread, such equipment is effectively being outlawed; and perhaps justifiably so, as, consider if the ground pin came loose for some reason (bad outlet, wiring, frayed cable, etc.): a person touching the chassis would be connected by a whole 0.1µF to mains, definitely enough to feel a tingle, and a potential hazard given the rightwrong circumstances. X capacitors are also not rated for line-to-ground service (the definition is line-to-line, with some other considerations like self-healing), and could create further hazards.
One can still operate such equipment, safely and unmodified, with the use of an isolation transformer.