Mega Evolutions counter as evolved Pokemon, so Shrine of Memories would allow them to use attacks from their basic Pokemon-EX form. Keep in mind however, that if the Mega Evolution was played directly through an effect such as Archie's Ace in the Hole so that there wasn't a basic Pokemon under it, it would not get this perk. This also applies to Stage 2 Pokemon put into play by Rare Candy. For example, if you had a Blastoise BCR on the bench that evolved directly from a Squirtle via Rare Candy, Shrine of Memories would allow it to use Squirtle's attacks but not Wartotle's.