Vacuum birefringence and X-ray polarimetry in transient magnetars