I'm not sure if this is specific to LineageOS, but I'm running LineageOS 16 based on Android 9, and I have the option to do this:
Go to settings>network & internet>mobile network>app data usage>click the specific app you want to restrict. Now you should see toggles for controlling the app's access to wifi, mobile data, etc.