Yes, you can perform a basic test of a transformer by injecting a sine wave into one side and monitoring the other side.
Keep the frequency in the ballpark of what the transformer was designed for.
Pick a transformer that doesn't have a giant turns-ratio. Otherwise, if you stepping down, the voltage will be small and difficult to measure accurately.
If you use the transformer as a step-up, be careful. There probably isn't enough current to be dangerous, but you might get an unpleasant shock.
I would use a transformer with wires instead of terminals.
Note that this is only a basic test, you won't be testing many of the important parameters of the transformer (saturation current, ...)
Edit: I just tested a transformer that I have. It is rated: 115 VAC to 6.3 VAC, 4.8A.
With a function generator, 10 Vp-p in yields 0.668 Vp-p out. A ratio of 14.97.
Using the transformer ratings: 115/6.3 = 18.25.
Why the difference? The function generator test is unloaded. This is a good indication of the turns ratio. If I were to put 115 VAC into the transformer and load it with 4.8A, the ratio would be closer to 14.97.