This is not a complete answer (only gives the answer for p=2,3,5) but it is also too long to add as a comment! Known results concerning similar questions as yours suggest that the nilpotency class of the whole group is a function depending on both the number of generators of the whole group as well as the prime p. For example there is a group of exponent 5 in which every 2-generated subgroup is nilpotent of class at most 6 and every 3-generator subgroup is of nilpotent class at most 8 and for m>3, every m-generated subgroup is of nilpotent class at most 2m. see the following Newman, M. F. (5-ANUM); Vaughan-Lee, Michael (4-OXCH) [Engel-4 groups of exponent 5. II. Orders](https://doi.org/10.1112/S0024611599011934). Proc. London Math. Soc. (3) 79 (1999), no. 2, 283–317. Of course you are asking of the nilpotency class of a finite p-group in which every 3-generator (2-generator) subgroup is at most p-1, so the above example does not apparently answer your question. The case 2-generator has been studied extensively but not for the nilpotency $p-1$ as you mentioned. The case $p=2$ implies the abelian and $p=3$ implies the nilpotency class 3 (as the group will be 2-Engel). The first non-trivial case is $p=5$ in which the group will be 4-Engel. If we assume 3-local assumption (that is every 3-generator subgroup is nilpotent of class $5-1=4$, then answer is positive and the nilpotency class of the whole group is at most 6. It follows from Corollary of H. Heineken, [Bounds for the nilpotency class of a group](https://doi.org/10.1112/jlms/s1-37.1.456), J. London Math. Soc. 37 (1962), 456–458. There is a related question. One may look at the following: Abdollahi, Alireza, [Certain locally nilpotent varieties of groups](https://doi.org/10.1017/S0004972700033578), Bull. Austral. Math. Soc. 67 (2003), no. 1, 115–119. ****************** Added in 25/May/2021 ******************* As I mentioned above, one may consider the case $p>5$. It follows from part (a) of Theorem 2.4 of A. Abdollahi and G. Traustason, [On locally finite $p$-groups satisfying an Engel condition] (https://doi.org/10.1090/S0002-9939-02-06421-3), Proc. Amer. Math. Soc. 130 (2002) 2827-2836. if $G$ is a finite $p$-group in which every 2-generator subgroup is nilpotent of class at most $p-1$, then $G^p:=\langle g^p \;|\; g\in G\rangle$ is nilpotent of class bounded by a function depending only on $p$. Now one may study $G/G^p$ having the same condition as $G$ (corresponding 2-local or 3-local as $G$). Hence, if there is a universal bound, we must have a universal bound on the nilpotency class of finite $p$-groups of exponent $p$ in which every $3$-generator subgroup is nilpotent of class at most $p-1$.