If these are really simple LEDs, you need an adjustable current source. A FET or transistor by itself, driven by PWM, will not act as a current source. But at least simple LEDs should not flicker when dimmed, except with the PWM frequency (480 or 960Hz). If you observe different flicker, the LEDs are not as simple as required.