The similarity in behavior between Lithium and Magnesium, and Beryllium and Aluminium, is known as:
The NCERT text explicitly mentions, 'In fact the behaviour of lithium and beryllium is more similar with the second element of the following group i.e., magnesium and aluminium, respectively. This sort of similarity is commonly referred to as diagonal relationship in the periodic properties.'