Effective field theories and inflationary magnetogenesis