The employer with whom the employee has the longest-standing contractual relationship, including where his contract of employment has given rise to a legal transfer within the meaning of Article L. 1224-1 or a contractual transfer within the meaning of Article L. 2253-1, is his main employer for the purposes of applying the provisions of this section.