Under EASA rules, what do I need to do to be able to perform aerobatics?
The appropriate rules are in FCL.800 Aerobatic Rating


A licensed pilot may not undertake aerobatic flights unless they hold an Aerobatic Rating
40 Hours of Flight Time (or 120 launches for sailplanes as PIC) completed after issue of respective license
Aerobatic Training course including theoretical knowledge and 5 hours or 20 flights
Aerobatics must subsequently be flown in same category aircraft as used for rating
No revalidation/renewal requirements
Be issued a certificate of satisfactory completion of the instruction for the license endorsement


So there is no specific license to be obtained, however there is a specific rating, which is just an endorsement in your logbook. 

Its not clear from the documents that I've read that formation flying qualifies as aerobatics. Some other countries don't consider formation flying an aerobatic operation.