Overview
This article presents several constant-current source implementations.
1. Op amp based current source
First, a reference voltage must be created. A classic way is to use a TL431, as shown below.

The op amp circuit is built as follows. Using the op amp virtual short, the output current I is given by I = Vref / Rref.

Connecting the two circuits above yields:
Simulation results are shown below.

From the formula the output current should be I = 2.495V / 2Ω = 1.2475A. However, the simulated value is slightly lower. The reason is that the current flowing through Rref includes not only the transistor collector current Ic but also the base current Ib. Measured values are shown below.

Ic + Ib = 1.2355A + 0.0123A = 1.2478A.
Changing Rload to 5Ω produces the following simulation result; the current remains unchanged.

2. Current source using two NPN transistors
Analyzing this circuit gives:
Ic + Ib_NPN1 = Vbe / Rref ? Ib_NPN2
With Vbe approximated as the transistor emitter junction drop (0.7V),
Ic = Vbe / Rref + Ib_NPN1 ? Ib_NPN2
Simulation result:
From the values:
Ic = 0.7V / 2Ω ? 0.003466A + 0.000101A = 0.346635A.
Typically base currents are very small and can be neglected. Therefore, for this circuit the simplified formula is:
Ic = Vbe / Rref
Because transistor Vbe is temperature dependent, this current source has limited accuracy.
3. TL431 plus transistor current source
To address the temperature sensitivity in the previous circuit, replace one transistor with a TL431 so that the TL431's 2.495V reference replaces the transistor Vbe.

Analysis of this circuit yields:
Vref / Rref = Io + Ib
where Vref = 2.495V.
Simulation result:
Therefore:
Io = 2.495V / 2Ω ? Ib = 1.2475A ? 0.00621A = 1.24129A
The small difference between the calculated Io and simulation is due to a small current into the TL431 reference pin. Since both Ib and the TL431 reference pin current are negligible, this current source can be approximated by:
Io = 2.495V / Rref
In the reasonable operating range, changing Rload does not affect the current through Rload. You may build and test these circuits on a bench or in simulation.