For the first time, astronomers witnessed the birth of a 'magnetar'