(Update in last section.)
I. Define the integral,
$$K_n(k)=\int_0^{\pi/2}\frac{\cos\left((1-\frac{2}n)\arcsin(k\sin x)\right)}{\sqrt{1-k^2 \sin^2 x}}dx=\tfrac{\pi}{2}\,_2F_1\left(\tfrac1{n},\tfrac{n-1}{n},1,\,k^2\right)$$
hence,
$$K_2(k)=K(k)=\int_0^{\pi/2}\frac{1}{\sqrt{1-k^2 \sin^2 x}}dx=\large{\tfrac{\pi}{2}\,_2F_1\left(\tfrac12,\tfrac12,1,\,k^2\right)}$$
$$K_3(k)=\int_0^{\pi/2}\frac{\cos\left(\frac13\,\arcsin(k\sin x)\right)}{\sqrt{1-k^2 \sin^2 x}}dx=\large{\tfrac{\pi}{2}\,_2F_1\left(\tfrac13,\tfrac23,1,\,k^2\right)}$$
$$K_4(k)=\int_0^{\pi/2}\frac{\cos\left(\frac12\,\arcsin(k\sin x)\right)}{\sqrt{1-k^2 \sin^2 x}}dx=\large{\tfrac{\pi}{2}\,_2F_1\left(\tfrac14,\tfrac34,1,\,k^2\right)}$$
$$K_6(k)=\int_0^{\pi/2}\frac{\cos\left(\frac23\,\arcsin(k\sin x)\right)}{\sqrt{1-k^2 \sin^2 x}}dx=\large{\tfrac{\pi}{2}\,_2F_1\left(\tfrac16,\tfrac56,1,\,k^2\right)}$$
These are Ramanujan's theory of elliptic functions for alternative bases of signature $2,3,4,6$, respectively. There are only 4 signatures.
II. Then, using Wolfram, I observed the closed-forms of the following definite integrals,
$$I_2 = \int_0^1 K_2(k)\, dk = {\tfrac{\pi}{2}\,_3F_2\left(\tfrac12,\tfrac12,\tfrac12;1,\tfrac32;1\right)}=2G$$
$$I_3 =\int_0^1 K_3(k)\, dk = {\tfrac{\pi}{2}\,_3F_2\left(\tfrac13,\tfrac23, \tfrac12;1,\tfrac32;1\right)}=\tfrac{3\sqrt3}2\, \ln2$$
$$I_4 =\int_0^1 K_4(k)\, dk = {\tfrac{\pi}{2}\,_3F_2\left(\tfrac14,\tfrac34,\tfrac12;1,\tfrac32;1\right)}=2\ln(1+\sqrt2)$$
$$I_6 =\int_0^1 K_6(k)\, dk = {\tfrac{\pi}{2}\,_3F_2\left(\tfrac16,\tfrac56,\tfrac12;1,\tfrac32;1\right)}=\tfrac{3\sqrt3}4\, \ln(2+\sqrt{3})$$
where $G$ is Catalan's constant. (Curiously, other than the first, Wolfram didn't recognize the closed-form of those hypergeometrics. I had to use the Inverse Symbolic Calculator.)
III. Question: Does the integral, or equivalently the generalized hypergeometric function, $$I_n=\tfrac{\pi}{2}\,_3F_2\left(\tfrac1n,\tfrac{n-1}n, \tfrac12; 1,\tfrac32;1\right)$$ have a closed form only for $n=2,3,4,6$? (I tried $n=5,7,8$, etc, and it doesn't seem to have a "neat" form using elementary functions.)
$\color{blue}{\text{IV. Update (Oct 2024)}}$
I somehow missed that Paul Enta last Jan 2024 answered this question and showed $I_n$ has a beautiful and general closed-form for all integer $n>1$. Thus, we finally have,
\begin{align} I_5 &=\int_0^1 K_5(k)\, dk = \tfrac{\pi}{2}\,_3F_2\left(\tfrac15,\tfrac45,\tfrac12;1,\tfrac32;1\right)\\ &=-\frac{10}3\,\sin\frac{\pi}5\times\left(\cos\frac{\pi}5\, \ln\left(\sin\frac{\pi}{10}\right)+\cos\frac{3\pi}5\, \ln\left(\sin\frac{3\pi}{10}\right)\right)\ \end{align}
and,
\begin{align} I_8 &=\int_0^1 K_8(k)\, dk = \tfrac{\pi}{2}\,_3F_2\left(\tfrac18,\tfrac78,\tfrac12;1,\tfrac32;1\right)\\ &=-\frac{8}3\,\sin\frac{\pi}8\times\left(\cos\frac{\pi}8\, \ln\left(\tan\frac{\pi}{16}\right)+\cos\frac{3\pi}8\, \ln\left(\tan\frac{3\pi}{16}\right)\right)\ \end{align}
and so on for other $n$. Or using radicals,
\begin{align} I_5 &= \frac{\,5^{5/4}}6\sqrt{\frac1{\phi}}\, \ln\left(2\,\phi^\sqrt5\right)\\[6pt] I_8 &= \frac{\,2^{1/2}}3\sqrt{\frac1{r}}\, \ln\left( \left(\frac{2^{3/4}+\sqrt{r}}{2^{3/4}-\sqrt{r}}\right)^\sqrt{r} \left(\frac{2^{3/4}+\sqrt{1/r}}{2^{3/4}-\sqrt{1/r}}\right)^\sqrt{1/r} \right) \end{align}
with golden ratio $\phi=\frac{1+\sqrt5}2$ and silver ratio $r = 1+\sqrt2$.
P.S. The transcendental constant $\phi^\sqrt5$ also appears as a limiting ratio in this post. And I have a feeling the $\ln(z)$ of $I_8$ can be simplified.