First, make sure it's oil and not grease gunk from the chain.
If you're sure it's engine oil, then you have to check if it's really coming from the gears shaft or from somewhere above. Oil always drips from the bottom of the engine, but it may be coming from the top.
Clean the engine as good as possible and let it sit or ride it until you see the oil leak again. Then inspect the engine again.
Once you identified the origin of the leak, then you have to investigate to see if it there is something broken, something loose, a worn gasket or seal.
If it's the gears shaft, check it it moves from side to side. (it shouldn't).
How many miles on the bike? Any recent drop or malfunction?
Check the oil level often!