Quantification of electronic and magnetoelastic mechanisms of first-order magnetic phase transitions from first principles: application to caloric effects in La(Fe x Si 1−x )13