Extract Local Maxima
Python, 54 bytes



f=lambda l,*p:l and l[:p&lt;=l[:1]&gt;=l[1:2]]+f(l[1:],l[0])


Try it online!

I/O is with tuples rather than lists.



Python, 57 bytes



f=lambda l,p=0:l and l[:[p]&lt;=l[:1]&gt;=l[1:2]]+f(l[1:],l[0])


Try it online!

Alt 57:

f=lambda l,p=0:l and l[l&lt;[max(p,*l[:2])]:1]+f(l[1:],l[0])