This type of transformer has two 120 V primary windings. You connect them in parallel to drive it from 120 V, and in series to drive it from 240 V.
To connect the windings in series, you first need to figure out which pins the two windings are connected to. This can be done easily with a ohmmeter or a continuity tester. Put one lead on one pin, then go around to the others. Two of them will show open connection. One of the other pins will show a few Ohms or tens of Ohms. That's the other end of the winding the first probe is on. The second winding is connected between the remaining two pins, although it is good to check this to make sure you didn't make a mistake.
Now that you know which pins go to each of the windings, the only question is which way they are connected. You can't tell polarity with a ohmmeter or continuity tester, because the windings themselves have no inherent polarity. The polarity is relative between the two windings.
Arbitrarily pick one pin of one of the windings and call it 1+, then the other pin of that winding 1-. Ultimately you are going to connect 1- to 2+, then apply 240 VAC between 1+ and 2-. You only have two choices for the remaining pins. They are either 2+ 2-, or 2- 2+.
Unfortunately, you can't just try it and see which way it works. If you happen to get it right, then the expected voltage will come out of the secondary, and all will be fine. However, if you get it wrong, the two primary windings will cancel each other's magnetic fields and together act like a shorted transformer. This may cause a puff of smoke to be emitted, or at best, a breaker to pop.
The way to test it is to apply a lower voltage or limit the current so that nothing is damaged. When the two primaries are connected backwards, then the secondary will have very little voltage. The secondary voltage will be much larger when the two primaries are connected with the right polarity.
There are several ways you might have available to you to achieve this. If you have some other low voltage transformer, like something designed to run a doorbell, a old model train, and the like, use it to drive the primary directly. Using a low voltage is preferable, but if you don't have anything like that available, connect the tranformer to line power but with something else in series. This something else should be able to run with full line power so that it won't get damaged in case your transformer is wired to look like a short. It also should be something "dumb" and preferably resistive. A desklamp with a old fashioned LEB (light emitting bulb) would be good. A dumb toaster would likely be OK, or some dumb heater. The more smarts and the associated electronics it has, the less likely it is to work well when the transformer drops some voltage.