Systematics of f electron delocalization in lanthanide and actinide elements under pressure