Hidden cages are obtained by freeing Electoons by defeating all the enemies and breaking the locks on the cage or a simple ground pound can break them open with one hit. There are typically 2 hidden areas in each level containing caged electoons and 1 at the end that you must free in order to complete the level.
There is only one cage in the flying zones which are unlocked upon completion of the level. If you are having trouble finding a secret area keep an open ear. You will hear them cry for help when you are near an entrance. The Electoons also appear on the medallion in the order they appear in the level so make sure to note which ones you are missing if you go to replay a level.