Very high energy follow-up programs of gravitational wave and transient alerts with the MAGIC telescopes