To elaborate on Jason's comment: consider a morphism of schemes $f:\mathrm{X}\rightarrow\mathrm{S}$, and an $f$-flat coherent sheaf $\mathscr{F}$ on $\mathrm{X}$. Then
(1) the singular locus $\mathrm{Sing}(\mathscr{F})$ of $\mathscr{F}$ (given by the points $x\in\mathrm{X}$ such that $\mathscr{F}$ is not locally free at $x$) is closed - if $r$ is the rank of $\mathscr{F}$, it is cut out by the $r$-th Fitting ideal sheaf of $\mathscr{F}$;
(2) $\mathscr{F}$ is locally free at $x\in\mathrm{X}$ if and only if $\mathscr{F}_{f(x)}$ is locally free at $x$, where $\mathscr{F}_{f(x)}$ denotes the restriction of $\mathscr{F}$ to $f^{-1}(f(x))$ - this follows from flatness of $\mathscr{F}$ and the Nakayama lemma.
By (1) and (2), $f(\mathrm{Sing}(\mathscr{F}))$ consists of all $s\in\mathrm{S}$ such that $\mathscr{F}_{s}$ is not locally free. If $f$ is proper, then of course the latter image is closed in $\mathrm{S}$.
Lemma 2.1.8 in The Geometry of Moduli Spaces of Sheaves by Huybrechts & Lehn is a good reference.