Example 2 Given $x<\frac{5}{4}$, find the maximum value of the function $f(x)=4 x-2+$ $\frac{1}{4 x-5}$.
® Given $4 x-50$, so
$$\begin{aligned}
f(x)= & 4 x-2+\frac{1}{4 x-5}=-\left(5-4 x+\frac{1}{5-4 x}\right)+3 \leqslant \\
& -2 \sqrt{(5-4 x) \frac{1}{5-4 x}}+3=-2+3=1
\end{aligned}$$

The equality holds if and only if $5-4 x=\frac{1}{5-4 x}$, i.e., $x=1$.