How does a transistor act as a oscillator?

A: actually any active components will oscillate with positive feedback

A transistor can be used as an amplifier along with an LC tank circuit to form an oscillator; it is an active device (as LIBURNO states) which will amplify the feedback signal coming out of the LC tank circuit. The tank circuit has a natural resonant frequency, meaning the L and C together will try to generate a specific frequency; this is then fed back into the input of the transistor amplifier, and the output is fed to the LC tank circuit exacerbating this oscillation until it reaches its' maximum level.

An inverting amplifier can be used similarly; the output is fed to the input; this will cause the output to change as fast as the amplifier can. The frequency of this design is much harder to control, but potentially higher. Also, without the LC tank, the output voltage will remain lower.