If "hardwired" behaviour turns out to be succesful in the survival game, it's nothing else but fitness and therefore perseveres in the genepool. Same goes for eyespots on bimacs, the "twig in a breeze" movement of chameleons or the ability of mimics and (likely) wonderpusses to observe and imitate. The imitation itself is based on the input of the moment and interpretation of events ("I see territorial damselfish, I must assume banded sea snake effect"), but again, the ability to perform the interpretation and act accordingly is the bit that's hardwired.
With (a two year lifespan and) no real parental care or social structure, there is not likely a meme based learning-process, as is with social animals such as our own species.