One generalization of Fourier series comes from Sturm Liouville theory. This arises naturally in the study of PDEs. For example, consider a 1-D wave equation on a finite interval: $ \begin{eqnarray} u_{tt}(x,t) &=& u_{xx}(x,t) \\ \forall t, \ \alpha_1 u(a,t) + \alpha_2 u_x(a,t)=0 & \quad \quad & \forall t, \ \beta_1 u(b,t) + \beta_2 u_x(b,t) = 0\\ \forall x \in [a,b], \ u(x,0) = f(x) & \quad \quad & \forall x \in [a,b], \ u_t(x,0) = g(x) \end{eqnarray} $ One way to solve this is to look for a solution of the form $u(x,t) = \sum_{n=1}^\infty w_n(t) \phi_n(x)$ where $\phi_n(x)$ are the eigenmodes of the system. If we had periodic boundary conditions, then these would be the standard Fourier basis functions. It's important that the eigenmodes form a basis so that the initial conditions can be satisfied for all $f,g \in \mathcal L^2 (a,b)$.
To find the eigenmodes, you solve for nontrivial solutions to y''=-\lambda y with the boundary conditions \alpha_1 y(a)+ \alpha_2 y'(a)=0, and \beta_1 y(b)+ \beta_2 y'(b)=0. These solutions are: $\mathcal B = \{c_n e^{i \sqrt{\lambda_n} x} + d_ne^{-i \sqrt{\lambda_n} x}\}_{n=1}^\infty$, where where $\lambda_n$ are the positive solutions to
$ \tan((b-a)\sqrt{\lambda_n})=\frac{\sqrt{\lambda_n}(\alpha_1 \beta_2+\alpha_2 \beta_1)}{\lambda_n \alpha_2 \beta_2-\alpha_1 \beta_1}. $
For general boundary conditions there's no closed-form solution for $\lambda_n$ other than the above implicit definition. (There are formulas for $c_n$ and $d_n$, but I'm omitting them.) Then by the Sturm Liouville theorem, the set $\mathcal B$ is an orthonormal basis for $\mathcal{L}^2(a,b)$.
In the basic case, $\alpha_1=\beta_1=1,$ $\ \alpha_2=\beta_2=0$, we get $\lambda_n = (n\pi/(b-a))^2$, and the orthonormal basis $\left\{ \sin\left(n \pi\frac{x-a}{b-a}\right)\right\}_{n=1}^\infty$. For the wave equation, this corresponds to the eigenmodes when the ends are held at $0$.
Admittedly, this isn't the same thing as the collection $\mathcal{\tilde{B}}=\{e^{\pm i \sqrt{\lambda_n}x}\}_{n=1}^\infty$ being a basis, but it does show that $\mathcal{\tilde{B}}$ spans $\mathcal{L}^2(a,b)$.